/*
 * user.h
 *
 *  Created on: 2010-1-28
 *      Author: gavinweng
 */
#ifndef USER_H
#define USER_H

#include <set>

class UserProperty
{
public:
	UserProperty (int x = 0, int y = 0,
			     double dayTrafficDemand=0, double nightTrafficDemand=0,
			     double power=0);
	UserProperty (const UserProperty &);
	int    x;
	int    y;
	double dayTrafficDemand;
	double nightTrafficDemand;
	double power; // in dB
	bool   cover;
	int    channel;
};

class UserComp
{
public:
	// Define order
	bool operator() (const UserProperty& A, const UserProperty& B)
	{
		if (A.power != B.power)
		{
			return (A.power > B.power);
		}
		else if (A.x != B.x)
		{
			return (A.x > B.x);
		}
		else
		{
			return (A.y > B.y);
		}
	}
};

typedef std::set<UserProperty, UserComp>  UserList;
//define container's iterator
typedef std::set<UserProperty, UserComp>::iterator UserList_IT;
//define container's reverse iterator
typedef std::set<UserProperty, UserComp>::reverse_iterator UserList_RIT;



#endif /* USER_H */
